<?php

class Application_Form_Question extends Zend_Form
{

    public function init()
    {
        // Set the method for the display form to POST
        $this->setMethod('post');
        $this->setName('questionform');
        
        // Add the comment element
        $this->addElement('text', 'question', array(
            'label'      => 'Question:',
            'size'      => 80,
            'required'   => true,
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(0, 300))
                )
        ));

        // Add the   comment element
        $this->addElement('hidden', 'questionnaire', array(
            'required'   => true,
             'validators' => array(
                    array('Regex',
                          false,
                          array('/^[0-9]*$/i'))
                )
        ));
 
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Save',
        ));
 
        // And finally add some CSRF protection
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));
    }


}

